﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:userControls="clr-namespace:HP.Cachalote.WPF.UserControls">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Converters.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    <Style x:Key="TextBoxBase" TargetType="{x:Type TextBox}">
        <Setter Property="FontFamily" Value="Segoe UI" />
        <Setter Property="FontSize" Value="15" />
        <Style.Triggers>
            <Trigger Property="Validation.HasError" Value="True">
                <Setter Property="Background" Value="Yellow"/>
                <Setter Property="ToolTip">
                    <Setter.Value>
                        <ToolTip DataContext="{Binding RelativeSource={RelativeSource Self}, Path=PlacementTarget}">
                            <Grid Width="200" Height="80">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <StackPanel Orientation="Horizontal" Background="DarkGray">
                                    <Image Source="/Resources/Images/Info.png" Margin="2" Height="24" Width="24" />
                                    <TextBlock Text="What happened?" TextWrapping="Wrap" Padding="5" Foreground="White" FontWeight="Bold" />
                                </StackPanel>
                                <TextBlock Grid.Row="1" Padding="5" Text="{Binding (Validation.Errors).CurrentItem.ErrorContent}" TextWrapping="Wrap" />
                            </Grid>
                        </ToolTip>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style TargetType="{x:Type TextBox}" />
    <Style x:Key="TodoItemTreeViewItemTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBoxBase}">
        <Setter Property="FontSize" Value="18" />
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="BorderThickness" Value="1" />
            </Trigger>
            <Trigger Property="IsFocused" Value="False">
                <Setter Property="BorderThickness" Value="0" />
            </Trigger>
            <DataTrigger Binding="{Binding IsMouseOver, ElementName=GridMainContent}" Value="True">
                <Setter Property="Background" Value="AliceBlue" />
            </DataTrigger>
            <!-- Show the Title & Note when no errors -->
            <Trigger Property="Validation.HasError" Value="False">
                <Setter Property="ToolTip">
                    <Setter.Value>
                        <userControls:TodoItemToolTipUserControl />
                    </Setter.Value>
                </Setter>
                <Setter Property="ToolTipService.InitialShowDelay" Value="1500" />
                <Setter Property="ToolTipService.ShowDuration" Value="10000" />
            </Trigger>
            <!-- Priority, Very High -->
            <DataTrigger Binding="{Binding Priority}" Value="1">
                <Setter Property="Foreground" Value="#ff3300" />
                <Setter Property="FontWeight" Value="Bold" />
            </DataTrigger>
            <!-- Priority, High -->
            <DataTrigger Binding="{Binding Priority}" Value="2">
                <Setter Property="Foreground" Value="#168bb8" />
                <Setter Property="FontWeight" Value="Bold" />
            </DataTrigger>
            <!-- Priority, Medium -->
            <DataTrigger Binding="{Binding Priority}" Value="3">
                <Setter Property="Foreground" Value="#6d9b17" />
                <Setter Property="FontWeight" Value="Bold" />
            </DataTrigger>
            <!-- Priority, Low -->
            <DataTrigger Binding="{Binding Priority}" Value="4">
                <Setter Property="Foreground" Value="#000000" />
            </DataTrigger>
            <DataTrigger Binding="{Binding IsMatched}" Value="False">
                <Setter Property="Foreground" Value="LightGray" />
                <Setter Property="FontStyle" Value="Italic" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="TodoItemTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBoxBase}">
        <Setter Property="BorderThickness" Value="0" />
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsFocused" Value="True" />
                    <Condition Property="Validation.HasError" Value="False" />
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="AliceBlue" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsFocused" Value="True" />
                    <Condition Property="Validation.HasError" Value="True" />
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="LightYellow" />
            </MultiTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="TodoLabelTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBoxBase}" />
    <Style x:Key="TodoItemNoteTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBoxBase}">
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="Background" Value="White" />
            </Trigger>
        </Style.Triggers>
        <Setter Property="Background" Value="#fafafa" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="AcceptsReturn" Value="True" />
        <Setter Property="VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
    </Style>
</ResourceDictionary>